package com.chuangjiangx.member.coupon.ddd.domain.model;

/**
 * 卡券新增来源
 */
public enum MbrCouponSourceType {
//    卡券来源 1-领取 2-储值
    CLAIMED("领取",1),
    STORED("储值",2);

    public final String name;
    public final Integer code;

    MbrCouponSourceType(String name,Integer code) {
        this.name = name;
        this.code = code;
    }

    public static MbrCouponSourceType getSourceType(Integer code){
        for(MbrCouponSourceType type : values()){
            if(type.code.equals(code)){
                return type;
            }
        }
        return null;
    }


}
